package com.xxdd.plugina

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.view.MotionEvent
import android.view.View
import android.widget.Button
import android.widget.Toast

class MainActivity : ShadowActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val startBtn1 : Button = findViewById(R.id.btn_start1) as Button
        val startBtn2 : Button = findViewById(R.id.btn_start2) as Button

        startBtn1.setOnClickListener(View.OnClickListener {
            Toast.makeText(that, "我是插件的土司。。。", Toast.LENGTH_SHORT).show();
        })


        startBtn2.setOnClickListener(View.OnClickListener {
            val intent =  Intent()
            intent.setClass(that, SecondActivity::class.java)
//            intent.putExtra("className", "SecondActivity")
            startActivity(intent)
        })


    }


    override fun onStart() {
        super.onStart()

    }

    override fun onResume() {
        super.onResume()

    }

    override fun onStop() {
        super.onStop()

    }

    override fun onDestroy() {
        super.onDestroy()

    }

    override fun onSaveInstanceState(outState: Bundle) {
        super.onSaveInstanceState(outState)

    }

    override fun onTouchEvent(event: MotionEvent): Boolean {

        return super.onTouchEvent(event)

    }

    override fun onBackPressed() {
        super.onBackPressed()

    }
}